#!/bin/bash

cd /home/molio/db_storage/backup/sync

filename=${1-barda}.sql
save_path=$HOME/workspaces/bar-database/.jenkins/barda.tar.gz

echo "select '开始导入rabc数据库...';" > $filename
echo "use rabc;" >> $filename
cat bak_rabc.sql >> $filename
echo "select 'rabc数据库导入完成!!!';" >> $filename

echo "select '开始导入rabc数据库的存储过程...';" >> $filename
cat bak_rabc_pfv.sql >> $filename
echo "select 'rabc数据库的存储过程导入完成!!!';" >> $filename

tar -czf $save_path $filename
